﻿using UnityEngine;
using ZCTouchDrawBoard;
using ZCUtil.DoubleBuffer;

public class MainCanvasRender : MonoBehaviour
{
    private DoublePaper m_DoublePaper;

    public int width = 1024;
    public int height = 1024;
    public int depth = 16;
    public RenderTextureFormat format = RenderTextureFormat.ARGB32;

    public DoublePaper DoublePaper => m_DoublePaper;

    public BasePaperView PaperA => m_DoublePaper.PaperA;

    public void Initialize()
    {
        m_DoublePaper = new DoublePaper(width, height, depth);
    }

    public void PostRender()
    {
        Graphics.Blit(Camera.current.activeTexture, PaperA.RenderTexture);
    }

    public void Uninitialize()
    {
        m_DoublePaper.Release();
    }
}
